﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace App
{
    public class Main
    {
        public string PrintFile(string x)
        {
            StreamReader sr = new StreamReader(@"M:\Test.txt");
            string slines;
            while (!sr.EndOfStream)
            {
                slines = sr.ReadLine();
                Console.WriteLine(slines);
            }
            return x;
        }

        public string Search(string name)
        {
            bool found = false;
            Console.Write("Team: ");
            string line;
            line = Console.ReadLine();

            StreamReader sr = new StreamReader(@"M:\Test.txt");

            string sline = "";

            while (sline != null && !found)
            {
                sline = sr.ReadLine();


                if (sline == name)
                {
                    found = true;
                    return sline;
                }
                else
                {
                    found = false;
                    
                }
            }
           return "not found";
          
        }

        public string Sort(string s)
        {

            List<int> slist = new List<int>();
            List<string> sslist = new List<string>();

            StreamReader sr = new StreamReader(@"M:\Test.txt");
            while (!sr.EndOfStream)
            {
                int v = 0;

                string line = sr.ReadLine();
                if (Int32.TryParse(line, out v))
                {
                    slist.Add(v);
                }
                else
                {
                    sslist.Add(line);
                }
            }


            sslist.Sort();
            slist.Sort();
            Console.WriteLine("Sorterad Poang");
            foreach (var item in slist)
            {
                Console.Write(item + "\n");
            }

            Console.WriteLine("Sorterad Team");
            foreach (var item in sslist)
            {

                Console.Write(item + "\n");
            }
            return s;


        }
        public void Login(string s)
        {
            StreamReader sr = new StreamReader(@"M:\Test.txt");
            Console.Write("-----------"


                         ,"------------");
            Console.Write("Sign in");
            Console.Write("User");
            string user;
            user = Console.ReadLine();
            Console.Write("User");
            string pass;
            pass = Console.ReadLine();

        }
    }
}
